import axios from "axios";
import request from "@/utils/request";

export const uploadImageService = (formData) => {
  return axios.post('https://hmajax.itheima.net/api/uploadimg',
     formData, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
    ,
    timeout: 5000 // 设置请求超时时间为5000毫秒（5秒）
  });
};

// export const uploadImageService = (formData) => {
//   return request.post('/upload', formData, {
//     headers: { 'Content-Type':'multipart/form-data' }
//   });
// };



// const { data } = await axios.post('/api/upload', formData, {
//   headers: { 'Content-Type': 'multipart/form-data' }
// })